package com.mall.business.controller;

import com.mall.business.domain.TLbImage;
import com.mall.business.domain.TProduct;
import com.mall.business.domain.TProductType;
import com.mall.business.service.ITLbImageService;
import com.mall.business.service.ITProductService;
import com.mall.business.service.ITProductTypeService;
import com.mall.common.core.controller.BaseController;
import com.mall.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *
 * 首页
 *
 */
@RestController
@RequestMapping("/webApiIndex")
public class ApiIndexController  extends BaseController {

    @Autowired
    private ITLbImageService tLbImageService;


    @Autowired
    private ITProductTypeService tProductTypeService;




    /**
     *
     * 轮播图列表
     *
     */
    @RequestMapping("/nologin/getLbImageList")
    public   AjaxResult getLbImageList(){
        List<TLbImage> tLbImages = tLbImageService.selectTLbImageList(null);
        return  AjaxResult.success(tLbImages);
    }

    /**
     *
     * 分类列表
     *
     */
    @RequestMapping("/nologin/getProductTypeList")
    public  AjaxResult getProductTypeList(){
        List<TProductType> tProductTypes = tProductTypeService.selectTProductTypeList(null);
        return AjaxResult.success(tProductTypes);
    }

}
